{% extends './base.html' %}
{% load staticfiles %}
{% block right %}
    <div>
        请输入1-5:<input type="text" id="a_id" value="">

        <script type="text/javascript">
            //数字：
            var numberObject1 = 1;
            var numberObject2 = 12;
            //字符串：
            var stringObject = "1";
            //布尔：
            var booleanObject = true;
            //空：
            var nullObject = null;
            //未定义：
            var undefinedObject = undefined;
            //对象
            var jsObject = Object;
            
            function add(x,y) {
                return x + y
            }
            divElement = document.getElementById("a_id");
            switch (divElement.value){
                case '1':
                    alert('a = 1');
                    break;
                case '2':
                    alert(add(numberObject1,numberObject2))
                    break;
                default:
                    alert('default');
            }
        </script>
    </div>
{% endblock %}